#ifndef _CHARACTER_NET_H
#define _CHARACTER_NET_H

#include "Character.h"
#include <g_socket.h>


enum{PACKET_ID_POS_NAME, PACKET_ID_KICK_PLAYER, PACKET_ID_CHARACTER_ACTION};

class GameClient;
class GameServer;

class BasePacket
{
public:
	int ID;
	BasePacket()
	{
	}
};

class Packet_Pos_Name : public BasePacket
{
public:
	float X, Y;
	float Dir;
	char Name[32];
	Packet_Pos_Name()
	{
		ID = PACKET_ID_POS_NAME;
	}
};

class Packet_Kick_Player : public BasePacket
{
public:
	char Name[32];
	Packet_Kick_Player()
	{
		ID = PACKET_ID_KICK_PLAYER;
	}
};

class Packet_Character_Action : public BasePacket
{
public:
	char Name[32];
	int ActionID;
	Packet_Character_Action()
	{
		ID = PACKET_ID_CHARACTER_ACTION;
	}
};

class CharacterNet : public Character
{
public:
	NetStream CurNS;
public:
	void StartConnect();
	void StartServer(NetListener &nl);
	
	void WorkClient(GameClient &curCC, float timePass);
	void WorkServer(GameServer &curGS);
};
typedef std::list<CharacterNet> V_CHERACTER_NET;

#endif